package main

import "fmt"

type children struct {
	name    string
	age     int
	gender  string
	address string
	hobby   string
}

func (c children) String() string {
	return fmt.Sprintf("%s今年%d岁了，是%s生，家住%s，喜欢%s",
		c.name, c.age, c.gender, c.address, c.hobby)

}

func main() {
	abstractDemo()
}
func abstractDemo() {
	var xiaoming = children{
		name:    "小明",
		age:     15,
		gender:  "男",
		address: "上海",
		hobby:   "打游戏",
	}
	var xiaohong = children{
		name:    "小红",
		age:     16,
		gender:  "女",
		address: "江苏",
		hobby:   "唱歌",
	}
	var xiaobai = children{
		name:    "小白",
		age:     18,
		gender:  "女",
		address: "山东",
		hobby:   "玩滑板",
	}
	fmt.Println(xiaoming)
	fmt.Println(xiaohong)
	fmt.Println(xiaobai)
}
